/* 
 * File:   inventorytest.cpp
 * Author: reinhard
 *
 * Created on March 11, 2011, 4:01 PM
 */

#include <stdlib.h>
#include "gtest/gtest.h"
#include "inventory.hpp"
#include "seed.hpp"
#include "fruit.hpp"
#include "inventoryconstants.hpp"

/*
  Inventory();
  void add(Item* new_item);
  Item* getItemAt(int slot_number); //TODO
  int getMoney();
  void modifyMoney(int money);
  void printMoney();
  void removeItem(Item* item); //TODO
*/

TEST(InventoryTest, SingleTest) {
  Inventory inv(0);
  Seed* dum = new Seed(0,0);
  Seed* dumi = new Seed(0,0);
  Fruit* dumdum = new Fruit(0,0);
  
  inv.modifyMoney(1000);
  EXPECT_EQ(inv.getMoney(),InventoryConstants::getInitialMoney() + 1000);

  inv.add(dum);
  inv.add(dumi);
  inv.add(dumdum);
  
  EXPECT_EQ(inv.numberOfItemsAtSlot(1),2);
  EXPECT_EQ(inv.numberOfItemsAtSlot(2),1);
  EXPECT_EQ(inv.getItemAt(1),dumi);
  EXPECT_EQ(inv.getItemAt(2),dumdum);
  
  inv.removeItem(dum);
  EXPECT_EQ(inv.numberOfItemsAtSlot(1),1);
  
}


